--> `; // 影音版 版型 var avivid_waterfall_video_module = `
`+ video_m3u8_module +`
` + title + `
` + content + `
`; return avivid_waterfall_video_module; case 'text': // 純文字版型 var avivid_waterfall_text_module = `
` + title + `
` + content + `
`; return avivid_waterfall_text_module; case 'dual_image': // 雙圖片版 版型 var avivid_waterfall_dual_images_module = `
` + title + `
` + content + `
喜歡
不喜歡
封鎖
`; return avivid_waterfall_dual_images_module; default: // 圖片版 版型 var avivid_waterfall_image_module = `
${up_content}
` + title + `
` + content + `
`; return avivid_waterfall_image_module; } } function closeButtonShow(version){ var closeButtonHtml = `
`; if(version == "video"){ setTimeout(function(){ jQuery("#avivid_waterfall_webpush_i").append(closeButtonHtml); }, 5000) }else{ jQuery("#avivid_waterfall_webpush_i").append(closeButtonHtml); } } function changeImgAndTextSection(wp_up_down_status, date_encode_str){ // wp_up_down_status 來自父層的AviviD.settings.wp_up_down_status 推播版面上下版區塊的狀態 var product_module = document.getElementById("avivid_waterfall_wp_product_area"+date_encode_str); var sb_text_module = document.getElementById("avivid_waterfall_wp_section"); var waterfall_module = document.getElementById("avivid_waterfall_webpush_i"); if (waterfall_module && product_module && sb_text_module){ sb_text_html = sb_text_module.outerHTML; product_html = product_module.outerHTML; waterfall_module.innerHTML = parseInt(wp_up_down_status) ? (sb_text_html + product_html) : (product_html + sb_text_html); return true; }else{ return false; } } webpush = { click_num: 0, NewsOrAllpage_area_clicked: 0, ad_area_clicked: 0, click: function(click_url, area='image_area') { parent.postMessage('avivid_webpush_click', '*'); switch(area){ case 'content_area': webpush.NewsOrAllpage_area_clicked += 1; break; case 'ad_area': default: webpush.ad_area_clicked += 1; break; } // TODO: 個別區域點擊少於2次時啟動連結 if (webpush.ad_area_clicked >= 2 || webpush.NewsOrAllpage_area_clicked >= 2){ // do nothing } else { window.open(click_url); // window.parent.open(click_url); // window.parent.location = click_url; if((with_button == 0 || with_button == "_") && data.likr_push == null){ // console.log('enable_close'); webpush.close(); } } // TODO: 區域點擊總和大於2次時像父層發出關閉元素的通知 enable_close = (webpush.ad_area_clicked + webpush.NewsOrAllpage_area_clicked) >= 2; if (enable_close) { // console.log('enable_close'); webpush.close(); } }, click_with_button: function(click_url){ parent.postMessage('avivid_webpush_click_with_button', '*'); window.parent.location = click_url; }, setting: function() { parent.postMessage('avivid_setting', '*'); }, close: function() { parent.postMessage('avivid_close', '*'); }, like: function() { parent.postMessage('avivid_like', '*'); }, unlike: function() { parent.postMessage('avivid_unlike', '*'); } } AviviD = { os: {} }; //讀取get值取得影片網址或其他參數 // let githubURL = new URL(window.location); // data = JSON.parse(decodeURIComponent(escape(atob(githubURL.searchParams.get('data').replace(/-| /g, "+").replace(/_/g, "/").replace(/%/g, '%25'))))); var data; function receiveMessageFromIndex ( event ) { window.removeEventListener("message", receiveMessageFromIndex , false); // console.log( 'receiveMessageFromIndex', event ); // console.log( 'data', event.data ); // data = JSON.parse(decodeURIComponent(escape(atob(event.data.replace(/-| /g, "+").replace(/_/g, "/").replace(/%/g, '%25'))))); // data 是object才做處理,不是則結束function if(typeof event.data == "object"){ data = event.data; // console.log( 'data', data ); // 將data轉換成iframe下的變數 for (key in data){ eval(key+"="+JSON.stringify(data[key])); } }else{ console.log(event.data); console.log(typeof event.data); return false; } if(b_img == "_"){ // console.log('no b_img'); // version = 'text'; b_img = ""; // $("#avivid_waterfall_wp_product_area").addClass("disappear"); } var d = new Date(); var y = d.getFullYear(); var m = d.getMonth()+1; var day = d.getDate(); var today = y + '_' + m + '-' + day; var des = escape(btoa(today)).replace(/%/g,''); des = des.split('').sort().join(''); des = des.substring(des.length*2/3)+des.substring( 0,des.length/3); add_imitation_subscribe_webpush_content(version, logo_img, s_img, b_img, click_url, title, content, video_url, des); if(b_img == ""){ $("#avivid_waterfall_wp_product_area"+des).addClass("disappear"); } // closeButtonShow(); //rick 暫時不要秀出powered by avivid if(web_id == 'imaple') { jQuery("#avivid_waterfall_wp_section_left_content").css("display", "none"); removeElement("avivid_waterfall_wp_product_text_area"); } // 如果開啟夾報按鈕則變更替換下半部內容為新聞內容 if (typeof with_button != "undefined" && with_button == 1 && button1_title != "_"){ // console.log('with_button, clip type'); $("#avivid_waterfall_wp_section_right_content").css({ "font-size": "12px", "white-space": "normal", "display": "-webkit-box", "-webkit-box-orient": 'vertical', "-webkit-line-clamp": '2', "line-height": "1.2em" }); if(typeof with_all_page != "undefined" && with_all_page == 1 ){ AviviD.withAllPage = `
查看更多文章
`; $("#avivid_waterfall_wp_section_right").append(AviviD.withAllPage); }else{ document.getElementById("avivid_waterfall_wp_section_right_title").innerText = button1_title; document.getElementById("avivid_waterfall_wp_section_right_content").innerText = button1_msg; document.getElementById("click_url_area").setAttribute("onclick", `webpush.click("`+button1_url+`", "content_area")`); $("#avivid_waterfall_wp_section_left_logo").css("background-image", `url("`+ data.button1_icon +`")`); } } else { // console.log('no with button'); } changeImgAndTextSection(wp_up_down_status, des); if(title_only == '1'){ $("#avivid_waterfall_wp_section_right_title").css("font-size","7vh"); $("#avivid_waterfall_wp_section_right_title").css("margin-right","15%"); $("#avivid_waterfall_wp_section_right_title").css("display","-webkit-box"); $("#avivid_waterfall_wp_section_right_title").css("overflow","hidden"); $("#avivid_waterfall_wp_section_right_title").css("text-overflow","ellipsis"); $("#avivid_waterfall_wp_section_right_title").css("-webkit-line-clamp","3"); $("#avivid_waterfall_wp_section_right_title").css("-webkit-box-orient","vertical"); $("#avivid_waterfall_wp_section_right_title").css("line-height","10vh"); $("#avivid_waterfall_wp_section_right_title").css("max-height","fit-content"); $("#avivid_waterfall_wp_section_right_title").css("white-space","unset"); $("#avivid_waterfall_wp_section_right_content").css("display","none"); } window.onmessage = function(e){ if (e.data == 'video_ready'){ parent.postMessage('video_ready', '*'); } else { console.log('avivid_none', e.data); } } closeButtonShow(data.version); window.parent.postMessage("webpush_already",'*'); } jQuery(window).on('load',function(){ //监听message事件 window.addEventListener("message", receiveMessageFromIndex, false); // window.parent.postMessage("webpush_already",'*'); });
48歲不顯老,無皺紋眼袋,原來要這樣保養!
上報Up media
前副手彭斯拒絕同台露面 川普卸任後28日將首度現身保守派峰會